package com.yxplearn.mybatisplus.deluxe;

import com.baomidou.mybatisplus.core.injector.AbstractMethod;
import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector;
import com.baomidou.mybatisplus.core.metadata.TableInfo;
import org.apache.ibatis.session.Configuration;

import java.util.List;

/**
 * @author : yang.xp
 * @date : 2022/5/24 12:08
 * @description :  SQL注入器
 */
public class YxpSqlInject extends DefaultSqlInjector {

    @Override
    public List<AbstractMethod> getMethodList(Configuration configuration, Class<?> mapperClass, TableInfo tableInfo) {
        List<AbstractMethod> methodList = super.getMethodList(configuration, mapperClass, tableInfo);
        methodList.add(new InsertAll("insertAll"));
        methodList.add(new ReplaceInto("replaceInfo"));
        methodList.add(new InsertOrUpdate("insertOrUpdate"));
        methodList.add(new ReplaceIntoList("replaceIntoList"));
        return methodList;
    }
}
